package service

import (
	"context"

	"gitee.com/thewalkers/refactoring-code/model"
)

// AddHourlyEmployeeTransactionService acts as a struct for injecting an implementation of EmployeeRepository
// for use in service methods
type AddHourlyEmployeeTransactionService struct {
	AddHourlyEmployeeTransactionRepository model.AddHourlyEmployeeTransactionRepository
}

// ACConfig will hold repository that will eventually be injected into this
// service layer
type AHConfig struct {
	AddHourlyEmployeeTransactionRepository model.AddHourlyEmployeeTransactionRepository
}

// NewAddCommissionedEmployeeTransactionService is a factory function for
// initializing a EmployeeService with its repository layer dependencies
func NewAddHourlyEmployeeTransactionService(a *AHConfig) model.AddHourlyEmployeeTransactionService {
	return &AddHourlyEmployeeTransactionService{
		AddHourlyEmployeeTransactionRepository: a.AddHourlyEmployeeTransactionRepository,
	}
}

func (a *AddHourlyEmployeeTransactionService) Create(ctx context.Context, e *model.Employee, h *model.HourClassification) error {
	return a.AddHourlyEmployeeTransactionRepository.Create(ctx, e, h)
}
